<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
  .HolyGrail {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
  }
  header,
  footer {
    flex: 1;
    background-color: #808080;
  }
  .HolyGrail-body {
    display: flex;
    flex: 4;
  }
  .HolyGrail-content {
    flex: 1;

  }
  .HolyGrail-nav, .HolyGrail-ads {
    /* 两个边栏的宽度设为12em */
    flex: 0 0 12em;
    background-color: rgba(0, 174, 255, 0.425)
  }
  .HolyGrail-nav {
    /* 导航放到最左边*/
    order: -1;
  }

  @media (max-width: 768px) {
    .HolyGrail-body {
      flex-direction: column;
      flex: 4;
    }
    .HolyGrail-nav,
    .HolyGrail-ads {
      flex: 1;
    }
    
    .HolyGrail-content {
      flex: 4;
    }
  }
  </style>
</head>
  <body class="HolyGrail">
    <header>Hearder</header>
    <div class="HolyGrail-body">
      <main class="HolyGrail-content">Content</main>
      <nav class="HolyGrail-nav">Nav</nav>
      <aside class="HolyGrail-ads">ads</aside>
    </div>
    <footer>Footer</footer>
  </body>
</html>